package mazegame;

import java.util.Timer;
import java.util.TimerTask;

import mazegame.GameStartTimer.UpdateTimerTask;

public class SyncServerAndBackupTimer {
	
	public Timer timer;
    private MazePlayer player;

    public SyncServerAndBackupTimer (MazePlayer playerUi)
    {
    	this.player = playerUi;
        timer = new Timer();
        timer.scheduleAtFixedRate(new SyncTimerTask(), 10, 10);
    }

    class SyncTimerTask extends TimerTask
    {
        public void run()
        {
        	try {
				player.syncServerAndBackup();
			} catch (Exception e) {
				e.printStackTrace();
			}
        }
    }

}
